functor Shrink (S : SHRINK_STRUCTS) : SHRINK =
struct
  open S
  
  structure I = Ir
  
  structure ConstFold = ConstFold (structure Ir = Ir)
  structure DeadCode = DeadCode (structure Ir = Ir)
  structure Inline = Inline (structure Ir = Ir)
  
  val tag = false
  
  fun shrink new =
      let val _ = if tag
                  then File.output ("irBeforeOpt.c", I.Program.toString new)
                  else ()
          val new = DeadCode.shrink new
          val new = ConstFold.shrink new
          (*val new = Inline.shrink new*)
          val _ = if tag
                  then File.output ("irAfterOpt.c", I.Program.toString new)
                  else ()
      in  new
      end
end